﻿<?php
//Establish Session
/**
 * @author Invisible Man
 * @copyright 2013
 */
 //Checking Admin
 require('../includes/admin_auth.php');
//Callback all pages
require('../config.php');
//Before Enable
$page_title ='Trang chủ';
$menu_ex = array (
    "member_list.php" => "Quản lý Member",
    "cate_list.php" => "Quản lý Danh mục",
    "news_list.php" => "Quản lý Tin tức"
);
$script = array(
    "function.js"
);
//Starting all pages
//Callback header
require('theme/default/header.php');
//Callback Content
//Connect DB
require('../includes/db_connect.php');
//Fill Data
$query = 'SELECT member_id FROM member';
$result = mysql_query($query, $db_con);
$member = mysql_numrows($result);

$query = 'SELECT cate_id FROM categories';
$result = mysql_query($query, $db_con);
$cate = mysql_numrows($result);

$query = 'SELECT news_id FROM news';
$result = mysql_query($query, $db_con);
$news = mysql_numrows($result);
echo '<table class="function_table" style="margin: 0px auto;">
    <tr>
        <td class="function_item button_member_add" onclick="user_click(\'member_add.php\')">
            <a href="member_add.php">Thêm User</a>
        </td>
        <td class="function_item button_member_list" onclick="user_click(\'member_list.php\')">
            <a href="member_list.php">Danh sách Member</a>
        </td>
        <td rowspan="3" class="statistics_panel">
            <b class="large">Thống kê</b><br /><br />
            Tổng số User: ' .$member. '<br />
            Tổng số danh mục: ' .$cate. '<br />
            Tổng số tin: ' .$news. '
        </td>
    </tr>
    <tr>
        <td class="function_item button_cate_add" onclick="user_click(\'cate_add.php\')">
            <a href="cate_add.php">Thêm Danh mục</a>
        </td>
        <td class="function_item button_cate_list" onclick="user_click(\'cate_list.php\')">
            <a href="cate_list.php">Liệt kê Danh mục</a>
        </td>
    </tr>
    <tr>
        <td class="function_item button_news_add" onclick="user_click(\'news_add.php\')">
            <a href="news_add.php">Thêm Tin tức</a>
        </td>
        <td class="function_item button_news_list" onclick="user_click(\'news_list.php\')">
            <a href="news_list.php">Liệt kê Tin tức</a>
        </td>
    </tr>
</table>';
//Callback Footer
require('theme/default/footer.php');


?>